package com.qingxin.wuye.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.qingxin.sys.entity.WxUser;

/**
 * 客户房产表
 * @author Administrator
 *
 */
@Entity
@Table(name = "wx_user_room_rel")
public class WxUserRoomRel extends com.qingxin.sys.entity.BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = -5772511438999882314L;

	private String id;
	private WxUser wxUser;
	private WyRoom wyRoom;
	private String createBy;
	private Date createTime;
	
	public WxUserRoomRel() {
	}
	
	
	public WxUserRoomRel(WxUser wxUser, WyRoom wyRoom, String createBy, Date createTime) {
		this.wxUser = wxUser;
		this.wyRoom = wyRoom;
		this.createBy = createBy;
		this.createTime = createTime;
	}


	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "wxuserid")
	public WxUser getWxUser() {
		return wxUser;
	}

	public void setWxUser(WxUser wxUser) {
		this.wxUser = wxUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "roomid")
	public WyRoom getWyRoom() {
		return wyRoom;
	}

	public void setWyRoom(WyRoom wyRoom) {
		this.wyRoom = wyRoom;
	}

	@Column(name = "create_by", length = 50)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
}
